<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../CSS/dl.css">
    <link rel="stylesheet" href="../font_3sqfkdkt64s/iconfont.css">
    <link rel="stylesheet" href="../font_cnubd6mcu1/iconfont.css">
    <!-- <link rel="stylesheet" href="../项目/CSS/尾部.css">
    <link rel="stylesheet" href="../项目/CSS/头部.css"> -->

</head>
<!-- <header></header>

<div class="box">
    <div class="top-box">
        <div class="ts">
            <h6 class="active" onclick="changeLoginType(0)">账号密码登录</h6>
            <h6 onclick="changeLoginType(1)">短信快捷登录</h6>
        </div>
        <div class="md-box"><input class="item_account" autocomplete="off" type="text" name="phone" id="phone" placeholder="手机号码"></div>
        <div class="md-box"><input class="item_account" autocomplete="off" type="text" name="phone" id="phone" placeholder="密码"></div>
    </div>

    <div class="lj-box"><input class="dl" id="login-button" type="submit" value="立即登录"></div>
</div>
<footer></footer> -->

<body>
    <header></header>
    <!-- 登陆框 -->
    <div class="big-box">
        <div class="box">
            <div class="top-box">
                <div class="ts">
                    <h6 class="active" onclick="changeLoginType(0)">账号密码登录</h6>
                    <h6 onclick="changeLoginType(1)">短信快捷登录</h6>
                </div>
                <div class="md-box"><input class="item_account" autocomplete="off" type="text" name="phone" id="username" placeholder="手机号码"></div>
                <div class="md-box"><input class="item_account" autocomplete="off" type="password" name="phone" id="userpass" placeholder="密码"></div>
            </div>
            <!-- 立即登陆框 -->

            <div class="lj-box"><input class="dl" id="btnLogin" type="submit" value="立即登录"></div>
            <!-- <div style="width: 380px;display: block;margin: 0 auto;height: 30px;">
                <div class="qtdl">
                    <div class="wz"> 其他登陆方式</div>
                </div>
            </div> -->
            <div style="display: block;width:358px;margin:0 auto;" class="other_login_type sns-login-container" id="custom_display_16">
                <fieldset class="tit">
                    <legend class="txt">其他方式登录</legend>
                </fieldset>
                <div class="popup_mask" style="display: none;" onclick="close();" id="global_loading">
                    <div class="bkc" onclick="close();">
                        <img _src="https://img.fishfay.com/theme/images/antacn/login/share.png" style="width: 80%; margin-right: 2em;">
                    </div>
                </div>
                <div class="oth_type_links">
                    <a class="icon_type btn_weixin sns-login-link" data-type="weixin" href="/antacom/passport/logint.html?t=wechat" title="微信登录"></a>
                </div>
                <!-- //微信登录 -->
                <div class="wx">
                    <a href="">
                        <div class="wxt"></div>
                    </a>
                </div>
            </div>
            <!-- /end -->
            <div class="end">
                <a href="">账号注册</a>
                <span>&nbsp;|</span>
                <a href="">忘记密码</a>
            </div>

        </div>

    </div>

    </div>
    <footer></footer>

</body>

</html>
<script src="../jQuery.js"></script>
<script src="../goodsAndShoppingCart/js/cookieTools.js"></script>
<script>
    $("header").load("head.html");
    $("footer").load("footer.html");
</script>

<script>
    let oBtnLogin = document.getElementById("btnLogin");
    let oUserPass = document.getElementById("userpass");
    let oUserName = document.getElementById("username");

    oBtnLogin.onclick = function() {
        let xhr = new XMLHttpRequest();
        xhr.open("post", "../goodsAndShoppingCart/login.php", true);

        xhr.onreadystatechange = function() {
            if (xhr.readyState == 4 && xhr.status == 200) {
                if (xhr.responseText == "﻿success") {
                    saveCookie("username", username.value, 7);
                    location.href = "all.html"
                } else {
                    window.alert("denglushibai")
                }
            }
        }

        xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

        let str = "username=" + oUserName.value + "&userpass=" + oUserPass.value;
        xhr.send(str);

    }
</script>